Skip to content

Adds Call Traces — per-turn STT/LLM/TTS latency for voice agent calls. - #123

Open
MSami625 wants to merge 150 commits into
mainfrom
otel-traces
Open

MSami625 wants to merge 150 commits into
mainfrom
otel-traces

Conversation

@MSami625

@MSami625 MSami625 commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

What Changed?

Adds Call Traces — per-turn STT/LLM/TTS latency for voice agent calls.

  • New /api/v1/observability/traces API (session create, OTLP ingest, list/detail, close)
  • DB tables for trace storage (078_synthetic_call_traces)
  • Pipecat integration SDK (efficientai.integrations.efficientai_traces) for external bots
  • In-process OTLP export for playground voice agents
  • Call Traces UI with waterfall, charts, and turn breakdown
  • Trace panels on evaluator results, playground calls, and observability views
  • Pipecat example bots + local test scripts

Why?

Reviewers need per-turn latency (STT / LLM / TTS) during playground runs, phone evals, and external Pipecat agents. This adds OTLP-based trace ingest correlated by call_short_id, so latency is visible in one place in the UI.

How to Test?

  1. Run eai start-all and confirm migration 078 applied.
  2. API smoke test:
    export EFFICIENTAI_API_KEY="..." EFFICIENTAI_WORKSPACE_ID="..."
    uv run python scripts/test_local_pipecat_trace.py
  3. Pipecat WebRTC: follow docs/synthetic-call-traces-pipecat.md → talk 2–3 turns → check Call Traces UI.
  4. Playground: run a voice agent call → confirm trace panel on call detail.
  5. Evaluator: run a trace-enabled eval → confirm trace on result detail.
  6. Run tests:
    uv run pytest tests/test_synthetic_trace_*.py tests/test_efficientai_traces_correlation.py tests/test_services/test_playground_tracing.py -q

Release Label

Select one semantic version bump intent for this PR:

  • major - breaking change, next release bumps major version
  • minor - backward-compatible feature, next release bumps minor version
  • fix - backward-compatible bug fix, next release bumps patch version
  • No label (defaults to patch release)

Intended release label: minor

Checklist

  • [x ] I have read the CONTRIBUTING.md guide.
  • [x ] My code follows the project's style guidelines.
  • [x ] I have added tests that prove my fix is effective or my feature works.
  • [x ] I have updated documentation where needed.

MSami625 and others added 30 commits August 7, 2026 19:02
Integrate latest security config (trusted hosts, rate limits, CSP docs,
security_settings module) while preserving OTLP traces, ClickHouse
settings, and proxy=true audio delivery on playground/observability.
Keep public doc staging in git for review and re-publish; ignore MCP publish scratch under scripts/.
…oads.

Stop tracking graph.db.zst (MCP-regenerated); extend gitignore for root MCP/Confluence scratch.
@MSami625 MSami625 added the minor Minor version update label Sep 18, 2026
@greptile-apps

greptile-apps Bot commented Sep 22, 2026

Copy link
Copy Markdown

Comments Outside Diff

These findings sit on lines the diff does not cover, so they could not be posted inline. Each one leaves this list once its file changes.

  • P1 Security Shared contexts cross-parent spans src/efficientai/utils/tracing/turn_trace_observer.py:193 ▶

    If two playground voice calls process turns concurrently in one API process, their per-call observers overwrite the same singleton conversation and turn contexts, so STT, LLM, and TTS spans from one call are parented into the other call's trace and stored with incorrect call or tenant correlation.

    How this was verified: Per-call observers write the singleton providers, and service decorators read those providers to select each span's parent.

Bring in ent gating, OSS quotas, and teammate UI/docs updates while keeping
otel traces routes, calls hub, integrations voice-agent list, and trace WS params.
Comment thread app/services/synthetic_traces/trace_service.py
@MSami625

Copy link
Copy Markdown
Collaborator Author

@greptile-apps

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

minor Minor version update

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant